/*
 * Copyright 2009 SHOP.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.shop.opensocial.mediated.shindig.factories;

import java.util.List;
import java.util.Set;

/**
 * Base class for the factory mediators. I'm using this base class so that I can remove access to
 * {@link GenericMediatorFactory#internalUnmake(Object)} and {@link GenericMediatorFactory#internalMake(Object)}. Java's
 * scoping rules regarding package and protected are very odd.
 *
 * @author Jordan Zimmerman
 */
public interface GenericMediatorFactoryBase<SHINDIG, MEDIATED>
{
	/**
	 * return a shindig instance from a mediated instance
	 *
	 * @param c mediated instance
	 * @return shindig instance
	 */
	public SHINDIG make(MEDIATED c);

	/**
	 * Return a mediated instance from a shindig instance
	 *
	 * @param c shindig instance
	 * @return mediated instnace
	 */
	public MEDIATED unmake(SHINDIG c);

	/**
	 * Return a list of shindig instances from a list of mediated instances
	 *
	 * @param mediatedList list of mediated instances
	 * @return list of shindig instances
	 */
	public List<SHINDIG> makeList(List<MEDIATED> mediatedList);

	/**
	 * Return a set of shindig instances from a set of mediated instances
	 *
	 * @param mediatedSet set of mediated instances
	 * @return set of shindig instances
	 */
	public Set<SHINDIG> makeSet(Set<MEDIATED> mediatedSet);

	/**
	 * Return a list of mediated instances from a list of shindig instances
	 *
	 * @param shindigList list of shindig instances
	 * @return list of mediated instances
	 */
	public List<MEDIATED> unmakeList(List<SHINDIG> shindigList);

	/**
	 * Return a set of mediated instances from a set of shindig instances
	 *
	 * @param shindigSet set of shindig instances
	 * @return set of mediated instances
	 */
	public Set<MEDIATED> unmakeSet(Set<SHINDIG> shindigSet);
}
